package cn.com.assistant.mapper;

import cn.com.assistant.entity.AnswerEntity;
import cn.com.assistant.entity.DataEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface AnswerMapper extends BaseMapper<AnswerEntity> {

    /**
     * 根据关联id查询
     * @param questionId
     * @return
     */
    List<AnswerEntity> findByQId(@Param("questionId") String questionId);

    /**
     * 根据关联id查询
     * @param questionId
     * @return
     */
    List<Map<String, Object>> findMapByQId(@Param("questionId") String questionId);

    /**
     * 根据问题id查询所有子级回复数据
     * @param questionId
     * @return
     */
    List<String> findIdByQId(@Param("questionId") String questionId);

    /**
     * 根据关联id删除数据
     * @param questionId
     * @return
     */
    int deleteByQId(@Param("questionId") String questionId);

    /**
     * 更新记录
     * @param answerEntity
     * @return
     */
    int update(AnswerEntity answerEntity);

    /**
     * 更新一级问题回复图片
     * @param answerEntity
     * @return
     */
    int updateImage(AnswerEntity answerEntity);



}
 
 
